package com.weiz.designpatterns.strategy;

public class Context {
    // 抽象策略
    private DiscountStrategy strategy = null;
    // 构造函数设置具体策略
    public Context(DiscountStrategy strategy) {
        this.strategy = strategy;
    }
    // 封装后的策略方法
    public void doAnything(){
        this.strategy.doDiscount();
    }
}